package org.wisdom.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.wisdom.request.PutPersonalDetailsRequest;
import org.wisdom.response.PersonalDetailsResponse;

@Mapper
public interface UserProfileMapper {
    @Select("select avatar_url from user where id = #{id}")
    String selectAvatarById(Long id);

    @Update("update user set avatar_url = #{url} where id = #{id}")
    void updateAvatarById(Long id, String url);

    void updatePersonalDetailsById(Long id, PutPersonalDetailsRequest putPersonalDetailsRequest);

    @Select("select enterprise, address, postcode, contacts, contacts_number from user where id = #{user}")
    PersonalDetailsResponse selectPersonalDetailsById(Long user);
}
